#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    map<int,int> mp;
    for(int i=0;i<4;i++){
        int num;
        cin>>num;
        mp[num]++;
    }
    int cnt=0;
    for(auto [x,y]:mp){
        cnt+=y/2;
    }
    cout<<cnt<<endl;

    return 0;
}